﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;

namespace SellerProject
{
    /// <summary>
    /// a javascript alert
    /// </summary>
    public class Alert
    {
        public Alert()
        {

        }

        public static void Show(string message)
        {
            string strMessage = message.Replace("'", "\\'");
            string script = "<script type=\"text/javascript\">alert('" + strMessage + "');</script>";
            Page page = HttpContext.Current.CurrentHandler as Page;
            if (page != null && !page.ClientScript.IsClientScriptBlockRegistered("alert"))
            {
                page.ClientScript.RegisterClientScriptBlock(typeof(Alert), "alert", script);
            }
        }

        public static void ShowMessage()
        {
            throw new Exception("The method or operation is not implemented.");
        }
    }
}